package com.spring.shops.dao;

import com.spring.shops.model.entity.TzCategory;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TzCategoryMapper {
    int deleteByPrimaryKey(Long categoryId);

    int insert(TzCategory record);

    int insertSelective(TzCategory record);

    TzCategory selectByPrimaryKey(Long categoryId);

    int updateByPrimaryKeySelective(TzCategory record);

    int updateByPrimaryKey(TzCategory record);
    /**
     * 列出所有的分类
     * @return
     */
    @Select("select * from tz_category")
    List<TzCategory> listCategory();
    @Select("select * from tz_category order by seq asc")
    TzCategory[] selectAll();
    @Select("select count(*) from tz_category where parent_id=#{id}")
    int selectParentId(long id);
}